import request from '@/api/request';
import { AxiosPromise } from 'axios';
import {
  BlogCategoryVO,
  BlogCategoryQuery,
  BlogCategoryPageResult,
  BlogCategoryStatisticsVO
} from './types';

export function getCategoryInfo(): AxiosPromise<BlogCategoryVO> {
  return request({
    url: '/api/v1/blogCategory/list',
    method: 'get'
  });
}

export function getCategoryStatistics(): AxiosPromise<BlogCategoryStatisticsVO> {
  return request({
    url: '/api/v1/blogCategory/statistics',
    method: 'get'
  });
}

/**
 * 分页列表
 *
 * @param queryParams
 */
export function pageBlogCategory(
  queryParams: BlogCategoryQuery
): AxiosPromise<BlogCategoryPageResult> {
  return request({
    url: '/api/v1/blogCategory/page',
    method: 'get',
    params: queryParams
  });
}
